(coding_restore_composition): Check invalid
authorKenichi Handa <handa@m17n.org>
Mon, 2 Feb 2004 12:06:47 +0000 (12:06 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 2 Feb 2004 12:06:47 +0000 (12:06 +0000)
composition data more rigidly.

src/coding.c

index d9620b907221f7f3d251cd78a8dfb4bc3d23b70f..7880e439e9dba2fdfc46d5374ae34bf01d406030 100644 (file)
@@ -5458,6 +5458,9 @@ coding_restore_composition (coding, obj)
              if (method == COMPOSITION_WITH_RULE_ALTCHARS
                  && len % 2 == 0)
                len --;
+             if (len < 1)
+               /* Invalid composition data.  */
+               break;
              for (j = 0; j < len; j++)
                args[j] = make_number (data[4 + j]);
              components = (method == COMPOSITION_WITH_ALTCHARS